<div class="bg-light lter b-b wrapper-md ng-scope">
    <h4 class="m-n font-thin">公告管理</h4>
    <!--<button ui-sref="app.notice" class="btn-back btn btn-dark btn-sm btn-rounded">-->
        <!--返回-->
    <!--</button>-->
</div>
<div class="wrapper-md">
    <div class="panel panel-default" ng-controller="addNoticeCtrl">
        <div class="panel-heading m-n">
            添加公告信息
        </div>
        <div class="panel-body">
            <form class="form-horizontal" name="noticeForm" ng-submit="addNotice()">
                <div class="form-group">
                    <label class="col-sm-2 control-label">公告标题</label>
                    <div class="col-sm-5">
                        <input name="name" ng-model="notice.name" type="text" placeholder="标题" class="form-control" required>
                    </div>
                    <div class="col-sm-5 form-text" ng-if="noticeForm.name.$touched">
                        <span class="text text-danger" ng-if="noticeForm.name.$error.required">公告名称是必填的</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">公告内容</label>
                    <div class="col-sm-5">
                        <textarea name="content" ng-model="notice.content" class="form-control" rows="4" placeholder="请输入您要发布的公告" required></textarea>
                    </div>
                    <div class="col-sm-5 form-text" ng-if="noticeForm.content.$touched">
                        <span class="text text-danger" ng-if="noticeForm.content.$error.required">公告内容是必填的</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">有效日期</label>
                    <div class="col-sm-5" ng-controller="DatepickerDemoCtrl">
                        <div class="input-group w-lg">
                            <input type="text" class="form-control" readonly="readonly" name="endTime" ng-model="notice.endTime" placeholder="请输入日期" alt-input-formats="altInputFormats" uib-datepicker-popup="yyyy-MM-dd" datepicker-popup="yyyy/MM/dd"
                                   alt-input-formats="altInputFormats" is-open="opened" datepicker-options="dateOptions" min-date="minDate" ng-required="true" close-text="关闭" clear-text="清空" current-text="今天" required/>
                            <span class="input-group-btn">
                                <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                            </span>
                        </div>
                    </div>
                    <div class="col-sm-5 form-text" ng-if="noticeForm.endTime.$touched">
                        <span class="text text-danger" ng-if="noticeForm.endTime.$error.required">公告有效日期必填</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">商&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户</label>
                    <div class="col-sm-5">
                        <div class="pull-left">
                            <label class="i-switch m-t-xs m-r">
                                <input type="checkbox" ng-model="notice.isShop" ng-true-value="1" ng-false-value="0">
                                <i></i>
                            </label>
                        </div>
                        <label class="pull-left m-t-xs m-r" ng-bind="{1:'是',0:'否'}[notice.isShop]"></label>
                        <i class="m-t-sm pull-left m-l-xs fa fa-question-circle text-muted pos-rlt h6"  popover-placement="top" popover="是否商户可以看" popover-trigger="mouseenter"></i>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">小&nbsp;&nbsp;程&nbsp;&nbsp;序</label>
                    <div class="col-sm-5">
                        <div class="pull-left">
                            <label class="i-switch m-t-xs m-r">
                                <input type="checkbox" ng-model="notice.isApi" ng-true-value="1" ng-false-value="0">
                                <i></i>
                            </label>
                        </div>
                        <label class="pull-left m-t-xs m-r" ng-bind="{1:'是',0:'否'}[notice.isApi]"></label>
                        <i class="m-t-sm pull-left m-l-xs fa fa-question-circle text-muted pos-rlt h6"  popover-placement="top" popover="是否小程序可以看" popover-trigger="mouseenter"></i>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">城市中心</label>
                    <div class="col-sm-5">
                        <div class="pull-left">
                            <label class="i-switch m-t-xs m-r">
                                <input type="checkbox" ng-model="notice.isCity" ng-true-value="1" ng-false-value="0">
                                <i></i>
                            </label>
                        </div>
                        <label class="pull-left m-t-xs m-r" ng-bind="{1:'是',0:'否'}[notice.isCity]"></label>
                        <i class="m-t-sm pull-left m-l-xs fa fa-question-circle text-muted pos-rlt h6"  popover-placement="top" popover="是否城市中心可以看" popover-trigger="mouseenter"></i>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button type="submit" class="btn btn-success" ng-disabled="noticeForm.$invalid">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
